#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n, a[1000], b[10] = { 0 };
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
		scanf("%d", &a[i]);

	for (int i = 0; i < n; i++)
		b[a[i] - 1]++;

	for (int i = 0; i < 8; i++)
		printf("%d %d\n", i + 1, b[i]);
	return 0;
}